#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int xt2_2(){
	int one=0;
	int count = 0;
	while (scanf("%d",&one)==1){
		count++;
		int two = 0;
		int three = 0;
		scanf("%d", &two);
		scanf("%d",&three);

		for (int i= 1;; i++){
			int tp = i * 7 + three;
			if (tp > 100){
				printf("Case %d:%s\n",count,"No answer");
				break;
			}
			if (tp % 5 == two&&tp % 3 == one){
				printf("Case %d:%d\n",count,tp);
				break;
			}
		}
	}

	return 0;
}